3.3.13 \(\int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+a \sec (e+f x)} \, dx\) [213]

Optimal. Leaf size=43 \[ \frac {d \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {(c-d) \tan (e+f x)}{f (a+a \sec (e+f x))} \]

[Out]

d*arctanh(sin(f*x+e))/a/f+(c-d)*tan(f*x+e)/f/(a+a*sec(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {4083, 3855, 3879} \begin {gather*} \frac {(c-d) \tan (e+f x)}{f (a \sec (e+f x)+a)}+\frac {d \tanh ^{-1}(\sin (e+f x))}{a f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(c + d*Sec[e + f*x]))/(a + a*Sec[e + f*x]),x]

[Out]

(d*ArcTanh[Sin[e + f*x]])/(a*f) + ((c - d)*Tan[e + f*x])/(f*(a + a*Sec[e + f*x]))

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3879

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[-Cot[e + f*x]/(f*(b + a*
Csc[e + f*x])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4083

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x
_Symbol] :> Dist[B/b, Int[Csc[e + f*x], x], x] + Dist[(A*b - a*B)/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x]
, x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]

Rubi steps

\begin {align*} \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+a \sec (e+f x)} \, dx &=(c-d) \int \frac {\sec (e+f x)}{a+a \sec (e+f x)} \, dx+\frac {d \int \sec (e+f x) \, dx}{a}\\ &=\frac {d \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {(c-d) \tan (e+f x)}{f (a+a \sec (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(109\) vs. \(2(43)=86\).
time = 0.28, size = 109, normalized size = 2.53 \begin {gather*} \frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \left (d \cos \left (\frac {1}{2} (e+f x)\right ) \left (-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )+(c-d) \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )\right )}{a f (1+\cos (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(c + d*Sec[e + f*x]))/(a + a*Sec[e + f*x]),x]

[Out]

(2*Cos[(e + f*x)/2]*(d*Cos[(e + f*x)/2]*(-Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + Log[Cos[(e + f*x)/2] + Si
n[(e + f*x)/2]]) + (c - d)*Sec[e/2]*Sin[(f*x)/2]))/(a*f*(1 + Cos[e + f*x]))

________________________________________________________________________________________

Maple [A]
time = 0.17, size = 61, normalized size = 1.42

method result size
derivativedivides \(\frac {c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )+d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{f a}\) \(61\)
default \(\frac {c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )+d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{f a}\) \(61\)
risch \(\frac {2 i c}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}-\frac {2 i d}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}-\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a f}+\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a f}\) \(91\)
norman \(\frac {\frac {\left (c -d \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}-\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}}{\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1}+\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a f}-\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a f}\) \(105\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(c+d*sec(f*x+e))/(a+a*sec(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f/a*(c*tan(1/2*f*x+1/2*e)-d*tan(1/2*f*x+1/2*e)-d*ln(tan(1/2*f*x+1/2*e)-1)+d*ln(tan(1/2*f*x+1/2*e)+1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (46) = 92\).
time = 0.28, size = 107, normalized size = 2.49 \begin {gather*} \frac {d {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} + \frac {c \sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+a*sec(f*x+e)),x, algorithm="maxima")

[Out]

(d*(log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/a - log(sin(f*x + e)/(cos(f*x + e) + 1) - 1)/a - sin(f*x + e)/(a*
(cos(f*x + e) + 1))) + c*sin(f*x + e)/(a*(cos(f*x + e) + 1)))/f

________________________________________________________________________________________

Fricas [A]
time = 3.25, size = 80, normalized size = 1.86 \begin {gather*} \frac {{\left (d \cos \left (f x + e\right ) + d\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (d \cos \left (f x + e\right ) + d\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (c - d\right )} \sin \left (f x + e\right )}{2 \, {\left (a f \cos \left (f x + e\right ) + a f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+a*sec(f*x+e)),x, algorithm="fricas")

[Out]

1/2*((d*cos(f*x + e) + d)*log(sin(f*x + e) + 1) - (d*cos(f*x + e) + d)*log(-sin(f*x + e) + 1) + 2*(c - d)*sin(
f*x + e))/(a*f*cos(f*x + e) + a*f)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {c \sec {\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx + \int \frac {d \sec ^{2}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+a*sec(f*x+e)),x)

[Out]

(Integral(c*sec(e + f*x)/(sec(e + f*x) + 1), x) + Integral(d*sec(e + f*x)**2/(sec(e + f*x) + 1), x))/a

________________________________________________________________________________________

Giac [A]
time = 0.49, size = 70, normalized size = 1.63 \begin {gather*} \frac {\frac {d \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac {d \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a} + \frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+a*sec(f*x+e)),x, algorithm="giac")

[Out]

(d*log(abs(tan(1/2*f*x + 1/2*e) + 1))/a - d*log(abs(tan(1/2*f*x + 1/2*e) - 1))/a + (c*tan(1/2*f*x + 1/2*e) - d
*tan(1/2*f*x + 1/2*e))/a)/f

________________________________________________________________________________________

Mupad [B]
time = 1.73, size = 41, normalized size = 0.95 \begin {gather*} \frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (c-d\right )}{a\,f}+\frac {2\,d\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{a\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d/cos(e + f*x))/(cos(e + f*x)*(a + a/cos(e + f*x))),x)

[Out]

(tan(e/2 + (f*x)/2)*(c - d))/(a*f) + (2*d*atanh(tan(e/2 + (f*x)/2)))/(a*f)

________________________________________________________________________________________